<%@ page import="com.edu.bean.User" %>
<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%--<%--%>
<%--    // 从request中获取用户对象--%>
<%--    User user = (User) request.getAttribute("user");--%>
<%--    if (user == null) {--%>
<%--        // 用户对象不存在，重定向到登录页面--%>
<%--        response.sendRedirect("login.jsp");--%>
<%--        return; // 终止后续代码的执行--%>
<%--    }--%>
<%--%>--%>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>

</head>
<body>


<h1>欢迎您${user.realName}</h1>
<table border="1">
    <tr>
        <th>书籍ID</th>
        <th>书名</th>
        <th>作者</th>
        <th>类型</th>
    </tr>
    <c:forEach items="${books }" var ="book" varStatus="num">
        <tr>
            <td>${book.bookId}</td>
            <td>${book.bookName}</td>
            <td>${book.writer}</td>
            <td>${book.bookType}</td>
        </tr>

    </c:forEach>


</table>

</body>
<script>

</script>
</html>